home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Go Ronald
/
Go Ronald Voice Interactive CD.iso
/
Data1.cab
/
_8D088414393A4AB0BB2239714C0C0C0B
/
scripts
/
frame_20
/
DoAction.as
Wrap
Text File
|
2005-08-05
|
2KB
|
82 lines
function interval()
{
RunBG._x -= nBotSpeed * 3;
bot_mc._x += nBotSpeed + 5;
mApplication.trace("ronald\'s x pos : " + RunBG._x);
if(RunBG._x < -300)
{
mApplication.trace("jump in");
bot_mc.gotoAndPlay("jumpin");
clearInterval(id);
}
else
{
mApplication.trace("don\'t jump in");
}
}
function enterWithMic()
{
if(active_mic.activityLevel < nPrevMicLevel & bWasGoingUp)
{
mApplication.trace("GO GO GO");
bWasGoingUp = false;
if(!nBotSpeed)
{
nBotSpeed = 7;
}
else
{
nBotSpeed += Math.round(nPrevMicLevel / 20);
}
}
if(active_mic.activityLevel > nPrevMicLevel)
{
bWasGoingUp = true;
}
nPrevMicLevel = active_mic.activityLevel;
RunBG._x -= nBotSpeed * 3;
bot_mc._x += nBotSpeed + 5;
if(RunBG._x < -300)
{
this.onEnterFrame = null;
bot_mc.gotoAndPlay("jumpin");
}
}
stop();
var nBotSpeed = 7;
x = 0;
Timer._visible = false;
Timer.gotoAndPlay("Start");
gogogo_mc.enabled = true;
bot_mc.gotoAndPlay(2);
gogogo_mc.onRelease = function()
{
mApplication.trace("click go go go ");
if(!nBotSpeed)
{
nBotSpeed = 7;
}
else
{
nBotSpeed += Math.round(Math.random() * 5) + 3;
}
};
if(userHasMic)
{
var nPrevMicLevel = 0;
var active_mic = Microphone["get"]();
var bWasGoingUp = false;
this.createEmptyMovieClip("sound_mc",this.getNextHighestDepth());
sound_mc.attachAudio(active_mic);
var inputSound = new Sound(sound_mc);
inputSound.setVolume(0);
this.onEnterFrame = function()
{
enterWithMic();
};
}
else
{
var id = setInterval(interval,80);
}